package xixirupan.tmgp.tencent.com.vmeim.ui.beautyshop.presenter;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import android.view.LayoutInflater;

import com.sch.rfview.AnimRFRecyclerView;

import java.util.List;

import xixirupan.tmgp.tencent.com.vmeim.ui.beautyshop.model.categorydetailbean.CategoryDataBiz;
import xixirupan.tmgp.tencent.com.vmeim.ui.beautyshop.model.categorydetailbean.IPostDeatiData;
import xixirupan.tmgp.tencent.com.vmeim.ui.beautyshop.model.categorydetailbean.ProductsBaen;

/**
 * Created by lenovo on 2016/10/25.
 */

public class CatgoryDetailPresenter {

    CatgoryDetailAdapter adapter;Context context;
    AnimRFRecyclerView rfRecyclerView;
    LayoutInflater inflater;
    public  CatgoryDetailPresenter(AnimRFRecyclerView rfRecyclerView,LayoutInflater inflater, Context context)
    {
        this.rfRecyclerView =rfRecyclerView;
        this.context =context;
        this.inflater =inflater;

    }


    public  void getData(String cid)
    {
        CategoryDataBiz  biz =new CategoryDataBiz();
        biz.getData(cid, new IPostDeatiData() {
            @Override
            public void postData(List<ProductsBaen> listts) {
                Log.i("categorydetail","------------>测试数据使用"+listts.size());
                adapter =new CatgoryDetailAdapter(listts,context,inflater);
                rfRecyclerView.setLayoutManager(new LinearLayoutManager(context,LinearLayoutManager.VERTICAL,false));
                rfRecyclerView.setAdapter(adapter);


            }
        });
    }
}
